# -*- coding: utf-8 -*-
# @Time : 2021/2/7 15:55
# @Author : zhangcheng
# @Software: PyCharm


from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, VARCHAR, DATETIME, BigInteger


Base = declarative_base()


class Comment(Base):
    __tablename__ = "comment"
    # 自增的id
    autoid = Column(BigInteger, primary_key=True)
    # 留言者的id，是User里autoid的外键
    writer = Column(BigInteger)
    # 被留言者的id，是User里autoid的外键
    reader = Column(BigInteger)
    # 最近修改时间，如果是新建的就是创建时间，如果是最近修改的就是最近修改时间
    time = Column(DATETIME)
    # 留言内容
    content = Column(VARCHAR(255))